<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!doctype html>
<html  class="x-admin-sm">
<head>
	<meta charset="UTF-8">
	<title>校园盒伙人管理员登陆</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/sources/css/font.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/sources/css/login.css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/sources/css/xadmin.css">
    <script src="${pageContext.request.contextPath}/sources/layui/layui.js" charset="utf-8"></script>
    
    <script type="text/javascript"
	src="${pageContext.request.contextPath}/sources/scripts/jquery-3.4.1.min.js"></script>
<script type="text/javascript">
	function loginSubmit() {
		//判断proCode、proName不能为空
		var user_name=$("#user_name").val();
		var user_password=$("#user_password").val();
		if(user_name==""||user_password==""){
			alert("用户名或密码不能为空");
			return;
		}
		//ajax请求发送到地址
		var url="${pageContext.request.contextPath}/loginSubmit";
		//ajax请求重要参数
		var param=$("#form").serialize();
		//ajax发送请求  post请求、get请求、ajax请求
		$.post(url,param,function(data) {
			//判断成功跳转到列表页面
			if(data=="1"){
				window.location.href="${pageContext.request.contextPath}/index";
			}else{
				alert(data);
			}
		});
	}
</script>
</head>
<body class="login-bg">
    
    <div class="login layui-anim layui-anim-up">
        <div class="message">校园盒伙人管理员登录</div>
        <div id="darkbannerwrap"></div>
        
        <form class="layui-form" id="form">
            <input name="user_name" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="user_password" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
            <input value="登录"  style="width:100%;" type="button" onclick="loginSubmit()">
            <hr class="hr20" >
        </form>
    </div>
</body>
</html>